'use strict';
module.exports = app => {
  const { CHAR } = app.Sequelize; // 获取数据类型
  const UserRole = app.modelmysql.define('userrole',
    {
      id: {
        type: CHAR(27),
        primaryKey: true,
      },
      tid: { type: CHAR(27) },
      userid: { type: CHAR(27) },
    }
  );
  UserRole.associate = function() {
    app.modelmysql.UserRole.belongsTo(app.modelmysql.RoleInfo, {
      foreignKey: 'roleid',
    });
  };
  return UserRole;
};
